Mathematical Functions of Rule Engine |
|
Mathematical functions can be used to perform mathematical operations on data, following the XPath Notations.
Apart from basic mathematical operations such as addition, subtraction, and so on, you can use functions to round off numbers to the nearest integer, and find the sum of all the numeric values in a nodeset.
The following table describes the various mathematical functions available in the rule engine function library and their usage.
Table 1. Rule Engine Mathematical Functions
Mathematical Functions |
Description |
Usage |
---|---|---|
sum(e) |
Returns the sum of the numeric value of each node in the specified node-set |
sum(e), where |
floor(e) |
Returns the largest integer that is not greater than the number argument |
floor(e), where |
ceiling(e) |
Returns the smallest integer that is greater than the number argument |
ceiling(e), where |
round(e) |
Rounds the number argument to the nearest integer |
round(e), where |